<div class="modal fade bs-modal-md" id="modelContent">
	<div class="modal-dialog modal-md">
        <div class="modal-content"></div>
    </div>
</div> 
<div class="portlet box green">
    <div class="portlet-title">
		<div class="caption"><i class="fa fa-cogs"></i>数据列表</div>
		<div class="tools"><a href="javascript:;" class="collapse" data-original-title="" title=""> </a></div>
		<div class="actions"><a href="#modelContent" thref="/productRecommend/add" class="btn white btn-sm ajax-model-get hidden" code="prodRecommend.add" data-toggle="modal"><i class="fa fa-plus"></i> 新增 </a></div>
    </div>
    <div class="portlet-body">
    	<div class="dataTables_wrapper no-footer">
			<div class="table-scrollable">
	        <table class="table table-striped table-bordered table-hover">
	            <thead>
	                <tr>
	                	<th>货品编号</th>
	                    <th>货品名称</th>
	                    <th>货品类别</th>
	                    <th>价格</th>
	                    <th>状态</th>
	                    <th class="col-md-2"> 操作 </th>
	                </tr>
	            </thead>
	            <tbody>
	                 #foreach ($!item in $!pageProductRecommend.result)
	                 #set($product = $!productMap.get($!item))
	                 #set($category = $!categoryMap.get($!item))
	                 <tr>
	                     <td> $!product.code </td>
	                     <td> $!product.name </td>
	                     <td> $!category.name </td>
	                     <td> $!product.salesPrice </td>
	                     <td id="$!item.id">#if($!item.flag) 启用 #else 禁用 #end</td>
	                     <td>
	                     	<a href="javascript:;" class="hidden" code="prodRecommend.modifiedStatus" style="text-decoration: none">
								<input type='checkbox' #if($!item.flag) checked #end data-size='small' class='make-switch' 
									sendid="$!{item.id}" data-on-color='success' data-off-color='warning' />
							</a>
							<a class="btn green btn-outline btn-sm  btn-sm ajax-delete hidden" code="prodRecommend.delete" href="javascript:;" thref="/productRecommend/delete.do?id=$!item.id">
								<i class="fa fa-trash"></i>
								删除
							</a>
	                     </td>
	                 </tr>
	                 #end
	            </tbody>
	        </table>
		</div>
		#set($page=$pageProductRecommend)
		#set($pageUrl="/productRecommend/list?$!queryString&pageNo=")
		#parse("_page.htm")
		</div>
	</div>
</div>
<script type="text/javascript" src="/assets/scripts/views-permission.js"></script>
<script type="text/javascript">
	bootstrapSwitch.init({url : "/productRecommend/modifiedStatus", ontext : "启用", offtext : "禁用"});
</script>